<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>User Registration</title>
</head>
<body>
<h1>用户注册</h1>
<form th:action="@{/register}" th:object="${user}" method="post">
    <!-- 显示错误信息 -->
    <div th:if="${error}">
        <p style="color: red;" th:text="${error}"></p>
    </div>

    <div>
        <label for="fullName">姓名：</label>
        <input type="text" id="fullName" th:field="*{fullName}" required />
    </div>
    <div>
        <label for="email">电子邮件：</label>
        <input type="email" id="email" th:field="*{email}" required />
    </div>
    <div>
        <label for="password">密码：</label>
        <input type="password" id="password" th:field="*{password}" required />
    </div>
    <div>
        <label for="birthday">生日 (yyyy-mm-dd)：</label>
        <input type="date" id="birthday" th:field="*{birthday}" required />
    </div>
    <div>
        <label>性别：</label>
        <input type="radio" id="male" th:field="*{gender}" value="Male" /> 男
        <input type="radio" id="female" th:field="*{gender}" value="Female" /> 女
    </div>
    <div>
        <label for="profession">职业：</label>
        <select id="profession" th:field="*{profession}">
            <option value="Developer">开发者</option>
            <!-- 添加更多选项 -->
        </select>
    </div>
    <div>
        <label for="married">已婚？</label>
        <input type="checkbox" id="married" th:field="*{married}" />
    </div>
    <div>
        <label for="note">备注：</label>
        <textarea id="note" th:field="*{note}"></textarea>
    </div>
    <button type="submit">注册</button>
</form>
</body>
</html>